<?php
/**
 * User: @lose
 * Date: 2019-09-25
 * Time: 17:38
 */

ini_set('display_errors', 1);
error_reporting(-1);

require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\model\wiki\BrandAreaModule;


$data = BrandAreaModule::select('*');

foreach ($data as $info) {
    $item = [];
    if($info['link_type']) {
        $item['link_type'] = $info['link_type'] . 'brand_prefecture';
        $item['link_params'] = json_encode(['brand_id' => substr($info['link_params'], 17)], JSON_UNESCAPED_UNICODE);
        BrandAreaModule::update($item, ['id' => $info['id']]);
    }
}